<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page contentType="text/html; charset=utf-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link href="${pageContext.request.contextPath }/resources/css/bootstrap.min.css" rel="stylesheet">
<link href="${pageContext.request.contextPath }/resources/css/bootstrap-theme.min.css" rel="stylesheet">
<script src="${pageContext.request.contextPath }/resources/js/jquery-1.11.1.min.js"></script>
<script src="${pageContext.request.contextPath }/resources/js/bootstrap.min.js"></script>
<link href="${pageContext.request.contextPath }/resources/css/common.css" rel="stylesheet">
<title>权限列表</title>
</head>
<body>
	<jsp:include page="../../common/header.jsp">
		<jsp:param name="module" value="admin" />
		<jsp:param name="title" value="权限列表" />
	</jsp:include>
	
	<div class="main">
		<h3>权限列表</h3>
		<button class="btn btn-primary" data-toggle="modal" data-target="#powerModal">新增权限</button>
		<table class="table table-hover table-striped">
			<thead>
      			<tr>
         			<th>ID</th>
         			<th>权限名称</th>
         			<th>权限表达式</th>
         			<th>操作</th>
      			</tr>
   			</thead>
   			<tbody>
   				<c:forEach items="${powerList }" var="power">
   					<tr>
   						<td>${power.powerId }</td>
   						<td>${power.powerName }</td>
   						<td>${power.powerExp }</td>
   						<td>
   							<a href="${pageContext.request.contextPath}/admin/toPowerEdit">修改</a>
							<a href="${pageContext.request.contextPath}/admin/delPower?powerId=${power.powerId }">删除</a>
   						</td>
   					</tr>
   				</c:forEach>
		   </tbody>
		</table>
		
		<div class="modal fade" id="powerModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
   			<div class="modal-dialog">
     	 		<div class="modal-content">
         			<div class="modal-header">
            			<button type="button" class="close"  data-dismiss="modal" aria-hidden="true">  &times; </button>
            			<h4 class="modal-title" id="myModalLabel"> 新增权限 </h4>
         			</div>
         			<div class="modal-body">
         				<form method="post" action="${pageContext.request.contextPath}/admin/addPower">
							<div class="form-group">
								<label for="powerName">权限名称</label> 
								<input type="text" class="form-control" id="powerName" name="powerName" placeholder="权限名称">
							</div>
							<div class="form-group">
								<label for="powerExp">权限表达式</label> 
								<input type="text" class="form-control" id="powerExp" name="powerExp" placeholder="权限表达式">
							</div>
							<button type="submit" class="btn btn-default">确定</button>
							<button type="button" class="btn btn-default"  data-dismiss="modal">关闭 </button>
						</form>
         			</div>
     	 		</div>
			</div>
		</div>
	</div>
	<jsp:include page="../../common/footer.jsp"></jsp:include>
</body>
</html>
